package org.example01.System1;

import java.time.LocalDate;

public class Student//implements Comparable<Student>
{
    private String ID;
    private String name;
    private int ChineseScore;
    private int MathScore;
    private LocalDate EnterDate;
    private String Email;
    private String avatar;
    private studentStatus studentStatus;

    public String getEmail() {
        return Email;
    }

    public void setEmail(String email) {
        Email = email;
    }

    public LocalDate getEnterDate() {
        return EnterDate;
    }

    public void setEnterDate(LocalDate enterDate) {
        EnterDate = enterDate;
    }


    public Student(String ID, String name, int ChineseScore, int MathScore, LocalDate EnterDate, String Email, String studentStatus) {
        this(ID, name, ChineseScore, MathScore, EnterDate, Email);
        this.studentStatus = org.example01.System1.studentStatus.getStatus(studentStatus);
    }

    public Student(String ID, String name, int ChineseScore, int MathScore, LocalDate EnterDate, String Email) {
        this(ID, name, ChineseScore, MathScore, EnterDate);
        this.Email = Email;
    }

    public Student(String ID, String name, int ChineseScore, int MathScore) {
        this(ID, name, ChineseScore, MathScore, LocalDate.now());
    }

    public Student(String ID, String name, int ChineseScore, int MathScore, LocalDate EnterDate) {
        this.ID = ID;
        this.name = name;
        this.ChineseScore = ChineseScore;
        this.MathScore = MathScore;
        this.EnterDate = EnterDate;
    }

    public org.example01.System1.studentStatus getStudentStatus() {
        return studentStatus;
    }

    public void setStudentStatus(org.example01.System1.studentStatus studentStatus) {
        this.studentStatus = studentStatus;
    }

    public String getID() {
        return ID;
    }

    public void setID(String ID) {
        this.ID = ID;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getChineseScore() {
        return ChineseScore;
    }

    public void setChineseScore(int chineseScore) {
        ChineseScore = chineseScore;
    }

    public int getMathScore() {
        return MathScore;
    }

    public void setMathScore(int mathScore) {
        MathScore = mathScore;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String toString() {
        return ID + "    " + name + "    " + ChineseScore + "    " + MathScore + "    " + getTotalScore() + "    " + EnterDate + "    " + Email + "    " + studentStatus;
    }

    public boolean equals(Student student) {
        if (this.ID.equals(student.ID) && this.name.equals(student.name) && this.ChineseScore == student.ChineseScore && this.MathScore == student.MathScore && this.EnterDate.equals(student.EnterDate)) {
            return true;
        } else {
            return false;
        }
    }

    public int getTotalScore() {
        return ChineseScore + MathScore;
    }
    /*public int findScoreBySubject(String subject){
        switch (subject) {
            case "语文":
                return ChineseScore;
            case "Math":
                return MathScore;
            default:
                return -1;
        }
    }*/
   /* @Override
    public int compareTo(Student o) {
        return this.getTotalScore() == o.getTotalScore()? (this.ID.compareTo(o.ID)) : this.getTotalScore() > o.getTotalScore()? 1 : -1;
    }*/
}
